const axios = require("axios")
 function buildImage(name,rs,baseUrl) {
     axios({
        method: "POST",
        url: baseUrl + "/build",
        data: rs,
        params: {
            dockerfile: "Dockerfile",
            t: name,
          },
        headers: {
            'Content-type': 'application/x-tar',
        },
    }).then(res => {
        console.log(res.data)
    })
   
}
 function pushImage(name,config,baseUrl) {
    axios({
        method: "POST",
        url: baseUrl + "/images/" + name + "/push",
        headers: {
            "X-Registry-Auth": config
        }
    })
}

module.exports = {buildImage, pushImage}